package com.sparrow.common.aoi;

import com.sparrow.common.aoi.domain.AOIEntity;
import com.sparrow.common.aoi.impl.ninegrid.AOIMap;
import com.sparrow.common.aoi.listener.AOIListener;

import java.util.Collection;

/**
 * AOI系统接口
 */
public interface AOISystem {
    /**
     * 查询感兴趣区域的所有AOI实体
     * @param mapData
     * @param x
     * @param y
     * @return
     */
    Collection<AOIEntity> queryAOIEntity(AOIMap mapData, int x, int y);

    /**
     * 添加AOI实体
     *
     * @param mapData
     * @param aoiEntity
     * @param x
     * @param y
     */
    void addAOIEntity(AOIMap mapData, AOIEntity aoiEntity, int x, int y);

    /**
     * 移除AOI实体
     * @param mapData
     * @param other
     */
    void removeAOIEntity(AOIMap mapData, AOIEntity other);

    /**
     * 更新AOI实体位置
     * @param mapData
     * @param aoiEntity
     * @param x
     * @param y
     */
    void updateAOIEntityPosition(AOIMap mapData, AOIEntity aoiEntity, int x, int y);

    /**
     * 注册监听器
     */
    void addListener(AOIListener listener);

    /**
     * 移除监听器
     */
    void removeListener(AOIListener listener);


}
